//
//  YCApp+Utility.m
//  MyUtils
//
//  Created by 唐可雄 on 16/8/15.
//  Copyright © 2016年 swustyc. All rights reserved.
//

#import "YCApp+Utility.h"

@implementation YCApp (Utility)

+ (NSString *)UUID {
    // 法一
    CFUUIDRef uuidRef = CFUUIDCreate(kCFAllocatorDefault);
    CFStringRef strRef = CFUUIDCreateString(kCFAllocatorDefault, uuidRef);
    CFRelease(uuidRef);
    return (__bridge NSString *)strRef;
    
    //    // 法二
    //    return [[NSProcessInfo processInfo] globallyUniqueString];
}

+ (BOOL)isJailbroken {
    BOOL jailBroken = NO;
    NSString *cydiaPath = @"/Applications/Cydia.app";
    NSString *aptPath = @"/private/var/lib/apt/";
    if ([[NSFileManager defaultManager] fileExistsAtPath:cydiaPath]) {
        jailBroken = YES;
    }
    if ([[NSFileManager defaultManager] fileExistsAtPath:aptPath]) {
        jailBroken = YES;
    }
    
    return jailBroken;
}

@end
